package xin.yangshuai.basic01.gof23.adapter.impl;

import xin.yangshuai.basic01.gof23.adapter.HdmiComputer;
import xin.yangshuai.basic01.gof23.adapter.HdmiToHdmiCable;

public class MyHdmiComputer implements HdmiComputer {

    private HdmiToHdmiCable hdmiToHdmiCable;

    @Override
    public void connect(HdmiToHdmiCable hdmiToHdmiCable) {
        this.hdmiToHdmiCable = hdmiToHdmiCable;
    }

    @Override
    public String show() {
        System.out.println("通过当前设备：hdmi电脑");
        if (hdmiToHdmiCable != null) {
            return hdmiToHdmiCable.show();
        }
        return null;
    }
}
